home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / AIncludes / ControlStrip.a < prev    next >
Text File  |  1996-05-01  |  10KB  |  391 lines

  1. ;
  2. ;    File:        ControlStrip.a
  3. ;
  4. ;    Contains:    Control Strip (for Powerbooks and Duos) Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0d3 on Copland DR1
  8. ;
  9. ;    Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10. ;
  11. ;    Bugs?:        If you find a problem with this file, send the file and version
  12. ;                information (from above) and the problem description to:
  13. ;
  14. ;                    Internet:    apple.bugs@applelink.apple.com
  15. ;                    AppleLink:    APPLE.BUGS
  16. ;
  17. ;
  18.     IF &TYPE('__CONTROLSTRIP__') = 'UNDEFINED' THEN
  19. __CONTROLSTRIP__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MENUS__') = 'UNDEFINED' THEN
  25.     include 'Menus.a'
  26.     ENDIF
  27.     IF &TYPE('__DIALOGS__') = 'UNDEFINED' THEN
  28.     include 'Dialogs.a'
  29.     ENDIF
  30. ;
  31. ;********************************************************************************************
  32. ;
  33. ;    messages passed to the modules
  34. ;
  35. ;********************************************************************************************
  36. ;
  37.  
  38. sdevInitModule                    EQU        0                    ; initialize the module
  39. sdevCloseModule                    EQU        1                    ; clean up before being closed
  40. sdevFeatures                    EQU        2                    ; return feature bits
  41. sdevGetDisplayWidth                EQU        3                    ; returns the width of the module's display
  42. sdevPeriodicTickle                EQU        4                    ; periodic tickle when nothing else is happening
  43. sdevDrawStatus                    EQU        5                    ; update the interface in the Control Strip
  44. sdevMouseClick                    EQU        6                    ; user clicked on the module's display area in the Control Strip
  45. sdevSaveSettings                EQU        7                    ; saved any changed settings in module's preferences file
  46. sdevShowBalloonHelp                EQU        8                    ; puts up a help balloon, if the module has one to display
  47. ;
  48. ;********************************************************************************************
  49. ;
  50. ;    Features supported by the module.  If a bit is set, it means that feature is supported.
  51. ;    All undefined bits are reserved for future use by Apple, and should be set to zero.
  52. ;
  53. ;********************************************************************************************
  54. ;
  55.  
  56. sdevWantMouseClicks                EQU        0                    ; notify the module of mouseDown events
  57. sdevDontAutoTrack                EQU        1                    ; call the module to do mouse tracking
  58. sdevHasCustomHelp                EQU        2                    ; module provides its own help messages
  59. sdevKeepModuleLocked            EQU        3                    ; module needs to be locked in the heap
  60. ;
  61. ;********************************************************************************************
  62. ;
  63. ;    Result values returned by the sdevPeriodicTickle and sdevIconMouseClick selectors.
  64. ;    If a bit is set, the module can request that a specific function is performed by
  65. ;    the Control Strip.  A result of zero will do nothing.  All undefined bits are reserved
  66. ;    for future use by Apple, and should be set to zero.
  67. ;
  68. ;********************************************************************************************
  69. ;
  70.  
  71. sdevResizeDisplay                EQU        0                    ; resize the module's display
  72. sdevNeedToSave                    EQU        1                    ; need to save changed settings, when convenient
  73. sdevHelpStateChange                EQU        2                    ; need to update the help message because of a state change
  74. sdevCloseNow                    EQU        3                    ; close a module because it doesn't want to stay around
  75. ;
  76. ;********************************************************************************************
  77. ;
  78. ;    miscellaneous
  79. ;
  80. ;********************************************************************************************
  81. ;
  82.  
  83. sdevFileType                    EQU        'sdev'                ; module's file type
  84.  
  85. sdevMenuItemMark                EQU        $A5                    ; `*': `checkmark' to use in popup menus
  86. ;     direction values for SBDrawBarGraph
  87.  
  88. BarGraphSlopeLeft                EQU        -1                    ; max end of sloping bar graph is on the left
  89. BarGraphFlatRight                EQU        0                    ; max end of flat bar graph is on the right
  90. BarGraphSlopeRight                EQU        1                    ; max end of sloping bar graph is on the right
  91. ;
  92. ;********************************************************************************************
  93. ;
  94. ;    utility routines to provide standard interface elements and support for common functions
  95. ;
  96. ;********************************************************************************************
  97. ;
  98. ;
  99. ; pascal Boolean SBIsControlStripVisible(void )
  100. ;
  101.     IF ¨ GENERATINGCFM THEN
  102.         Macro
  103.         _SBIsControlStripVisible
  104.             moveq               #0,D0
  105.             dc.w                $AAF2
  106.         EndM
  107.     ELSE
  108.         IMPORT_CFM_FUNCTION SBIsControlStripVisible
  109.     ENDIF
  110.  
  111. ;
  112. ; pascal void SBShowHideControlStrip(Boolean showIt)
  113. ;
  114.     IF ¨ GENERATINGCFM THEN
  115.         Macro
  116.         _SBShowHideControlStrip
  117.             move.w              #$0101,D0
  118.             dc.w                $AAF2
  119.         EndM
  120.     ELSE
  121.         IMPORT_CFM_FUNCTION SBShowHideControlStrip
  122.     ENDIF
  123.  
  124. ;
  125. ; pascal Boolean SBSafeToAccessStartupDisk(void )
  126. ;
  127.     IF ¨ GENERATINGCFM THEN
  128.         Macro
  129.         _SBSafeToAccessStartupDisk
  130.             moveq               #2,D0
  131.             dc.w                $AAF2
  132.         EndM
  133.     ELSE
  134.         IMPORT_CFM_FUNCTION SBSafeToAccessStartupDisk
  135.     ENDIF
  136.  
  137. ;
  138. ; pascal short SBOpenModuleResourceFile(OSType fileCreator)
  139. ;
  140.     IF ¨ GENERATINGCFM THEN
  141.         Macro
  142.         _SBOpenModuleResourceFile
  143.             move.w              #$0203,D0
  144.             dc.w                $AAF2
  145.         EndM
  146.     ELSE
  147.         IMPORT_CFM_FUNCTION SBOpenModuleResourceFile
  148.     ENDIF
  149.  
  150. ;
  151. ; pascal OSErr SBLoadPreferences(ConstStr255Param prefsResourceName, Handle *preferences)
  152. ;
  153.     IF ¨ GENERATINGCFM THEN
  154.         Macro
  155.         _SBLoadPreferences
  156.             move.w              #$0404,D0
  157.             dc.w                $AAF2
  158.         EndM
  159.     ELSE
  160.         IMPORT_CFM_FUNCTION SBLoadPreferences
  161.     ENDIF
  162.  
  163. ;
  164. ; pascal OSErr SBSavePreferences(ConstStr255Param prefsResourceName, Handle preferences)
  165. ;
  166.     IF ¨ GENERATINGCFM THEN
  167.         Macro
  168.         _SBSavePreferences
  169.             move.w              #$0405,D0
  170.             dc.w                $AAF2
  171.         EndM
  172.     ELSE
  173.         IMPORT_CFM_FUNCTION SBSavePreferences
  174.     ENDIF
  175.  
  176. ;
  177. ; pascal void SBGetDetachedIndString(StringPtr theString, Handle stringList, short whichString)
  178. ;
  179.     IF ¨ GENERATINGCFM THEN
  180.         Macro
  181.         _SBGetDetachedIndString
  182.             move.w              #$0506,D0
  183.             dc.w                $AAF2
  184.         EndM
  185.     ELSE
  186.         IMPORT_CFM_FUNCTION SBGetDetachedIndString
  187.     ENDIF
  188.  
  189. ;
  190. ; pascal OSErr SBGetDetachIconSuite(Handle *theIconSuite, short theResID, unsigned long selector)
  191. ;
  192.     IF ¨ GENERATINGCFM THEN
  193.         Macro
  194.         _SBGetDetachIconSuite
  195.             move.w              #$0507,D0
  196.             dc.w                $AAF2
  197.         EndM
  198.     ELSE
  199.         IMPORT_CFM_FUNCTION SBGetDetachIconSuite
  200.     ENDIF
  201.  
  202.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  203. ;
  204. ; pascal short SBTrackPopupMenu(const Rect *moduleRect, MenuHandle theMenu)
  205. ;
  206.     IF ¨ GENERATINGCFM THEN
  207.         Macro
  208.         _SBTrackPopupMenu
  209.             move.w              #$0408,D0
  210.             dc.w                $AAF2
  211.         EndM
  212.     ELSE
  213.         IMPORT_CFM_FUNCTION SBTrackPopupMenu
  214.     ENDIF
  215.  
  216.     ENDIF
  217. ;
  218. ; pascal short SBTrackSlider(const Rect *moduleRect, short ticksOnSlider, short initialValue)
  219. ;
  220.     IF ¨ GENERATINGCFM THEN
  221.         Macro
  222.         _SBTrackSlider
  223.             move.w              #$0409,D0
  224.             dc.w                $AAF2
  225.         EndM
  226.     ELSE
  227.         IMPORT_CFM_FUNCTION SBTrackSlider
  228.     ENDIF
  229.  
  230. ;
  231. ; pascal OSErr SBShowHelpString(const Rect *moduleRect, StringPtr helpString)
  232. ;
  233.     IF ¨ GENERATINGCFM THEN
  234.         Macro
  235.         _SBShowHelpString
  236.             move.w              #$040A,D0
  237.             dc.w                $AAF2
  238.         EndM
  239.     ELSE
  240.         IMPORT_CFM_FUNCTION SBShowHelpString
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal short SBGetBarGraphWidth(short barCount)
  245. ;
  246.     IF ¨ GENERATINGCFM THEN
  247.         Macro
  248.         _SBGetBarGraphWidth
  249.             move.w              #$010B,D0
  250.             dc.w                $AAF2
  251.         EndM
  252.     ELSE
  253.         IMPORT_CFM_FUNCTION SBGetBarGraphWidth
  254.     ENDIF
  255.  
  256. ;
  257. ; pascal void SBDrawBarGraph(short level, short barCount, short direction, Point barGraphTopLeft)
  258. ;
  259.     IF ¨ GENERATINGCFM THEN
  260.         Macro
  261.         _SBDrawBarGraph
  262.             move.w              #$050C,D0
  263.             dc.w                $AAF2
  264.         EndM
  265.     ELSE
  266.         IMPORT_CFM_FUNCTION SBDrawBarGraph
  267.     ENDIF
  268.  
  269.     IF FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED THEN
  270. ;
  271. ; pascal void SBModalDialogInContext(ModalFilterUPP filterProc, short *itemHit)
  272. ;
  273.     IF ¨ GENERATINGCFM THEN
  274.         Macro
  275.         _SBModalDialogInContext
  276.             move.w              #$040D,D0
  277.             dc.w                $AAF2
  278.         EndM
  279.     ELSE
  280.         IMPORT_CFM_FUNCTION SBModalDialogInContext
  281.     ENDIF
  282.  
  283.     ENDIF
  284. ;  The following routines are available in Control Strip 1.2 and later. 
  285. ;
  286. ; pascal OSErr SBGetControlStripFontID(short *fontID)
  287. ;
  288.     IF ¨ GENERATINGCFM THEN
  289.         Macro
  290.         _SBGetControlStripFontID
  291.             move.w              #$020E,D0
  292.             dc.w                $AAF2
  293.         EndM
  294.     ELSE
  295.         IMPORT_CFM_FUNCTION SBGetControlStripFontID
  296.     ENDIF
  297.  
  298. ;
  299. ; pascal OSErr SBSetControlStripFontID(short fontID)
  300. ;
  301.     IF ¨ GENERATINGCFM THEN
  302.         Macro
  303.         _SBSetControlStripFontID
  304.             move.w              #$010F,D0
  305.             dc.w                $AAF2
  306.         EndM
  307.     ELSE
  308.         IMPORT_CFM_FUNCTION SBSetControlStripFontID
  309.     ENDIF
  310.  
  311. ;
  312. ; pascal OSErr SBGetControlStripFontSize(short *fontSize)
  313. ;
  314.     IF ¨ GENERATINGCFM THEN
  315.         Macro
  316.         _SBGetControlStripFontSize
  317.             move.w              #$0210,D0
  318.             dc.w                $AAF2
  319.         EndM
  320.     ELSE
  321.         IMPORT_CFM_FUNCTION SBGetControlStripFontSize
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal OSErr SBSetControlStripFontSize(short fontSize)
  326. ;
  327.     IF ¨ GENERATINGCFM THEN
  328.         Macro
  329.         _SBSetControlStripFontSize
  330.             move.w              #$0111,D0
  331.             dc.w                $AAF2
  332.         EndM
  333.     ELSE
  334.         IMPORT_CFM_FUNCTION SBSetControlStripFontSize
  335.     ENDIF
  336.  
  337. ;
  338. ; pascal OSErr SBGetShowHideHotKey(short *modifiers, unsigned char *keyCode)
  339. ;
  340.     IF ¨ GENERATINGCFM THEN
  341.         Macro
  342.         _SBGetShowHideHotKey
  343.             move.w              #$0412,D0
  344.             dc.w                $AAF2
  345.         EndM
  346.     ELSE
  347.         IMPORT_CFM_FUNCTION SBGetShowHideHotKey
  348.     ENDIF
  349.  
  350. ;
  351. ; pascal OSErr SBSetShowHideHotKey(short modifiers, unsigned char keyCode)
  352. ;
  353.     IF ¨ GENERATINGCFM THEN
  354.         Macro
  355.         _SBSetShowHideHotKey
  356.             move.w              #$0213,D0
  357.             dc.w                $AAF2
  358.         EndM
  359.     ELSE
  360.         IMPORT_CFM_FUNCTION SBSetShowHideHotKey
  361.     ENDIF
  362.  
  363. ;
  364. ; pascal OSErr SBIsShowHideHotKeyEnabled(Boolean *enabled)
  365. ;
  366.     IF ¨ GENERATINGCFM THEN
  367.         Macro
  368.         _SBIsShowHideHotKeyEnabled
  369.             move.w              #$0214,D0
  370.             dc.w                $AAF2
  371.         EndM
  372.     ELSE
  373.         IMPORT_CFM_FUNCTION SBIsShowHideHotKeyEnabled
  374.     ENDIF
  375.  
  376. ;
  377. ; pascal OSErr SBEnableShowHideHotKey(Boolean enabled)
  378. ;
  379.     IF ¨ GENERATINGCFM THEN
  380.         Macro
  381.         _SBEnableShowHideHotKey
  382.             move.w              #$0115,D0
  383.             dc.w                $AAF2
  384.         EndM
  385.     ELSE
  386.         IMPORT_CFM_FUNCTION SBEnableShowHideHotKey
  387.     ENDIF
  388.  
  389.     ENDIF ; __CONTROLSTRIP__ 
  390.  
  391.